package com.qf.netty.application;

import org.kurento.client.KurentoClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * author Ken
 * create_time 2023/1/4
 */
@SpringBootApplication
@ComponentScan("com.qf")
public class NettyWsApplication {

    public static void main(String[] args) {
        SpringApplication.run(NettyWsApplication.class, args);
    }

    @Value("${kms.url}")
    private String kmsUrl;

    /**
     * 信令服务器通过 KurentoClient对象和KMS服务器之间保持WebSocket长连接，这个长连接只需要一条就够了
     * 和主播方的数量无关
     * @return
     */
    @Bean
    public KurentoClient getKurentoClient(){
        return KurentoClient.create(kmsUrl);
    }
}
